//
//  LocationDecoder.h
//  XMJJ_zml
//
//  Created by 杨何华 on 2025/5/27.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

NS_ASSUME_NONNULL_BEGIN

@interface LocationDecoder : NSObject<CLLocationManagerDelegate>

@property (nonatomic, strong) CLLocationManager *locationManager;
@property (nonatomic, strong) CLGeocoder *geocoder;
@property (nonatomic, copy) void(^completionHandler)(NSDictionary *addressInfo, NSError *error);

// 单例方法
+ (instancetype)sharedDecoder;

// 根据经纬度解码
- (void)reverseGeocodeLocation:(CLLocation *)location
                    completion:(void(^)(NSDictionary *addressInfo, NSError *error))completion;

// 直接获取当前位置并解码
- (void)getCurrentLocationWithCompletion:(void(^)(NSDictionary *addressInfo, NSError *error))completion;

@end

NS_ASSUME_NONNULL_END
